package com.itheima.repository;

import com.itheima.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface RoleRepository extends JpaRepository<Role, Long> {

    // 通过 User 的name 查找 Role
    Role findByUser_Username(String userName);  // 确保路径从 Role 到 User，再到 userName
}
